package com.dxb.yomall.ware.dao;

import com.dxb.yomall.ware.entity.WareSkuEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
/**
 * 商品库存
 * 
 * @author daixinbao
 * @email 1065808217@qq.com
 * @date 2021-01-05 22:30:16
 */
@Repository
public interface WareSkuDao extends BaseMapper<WareSkuEntity> {
    /**
     * 更新商品库存
     * @param skuId
     * @param wareId
     * @param skuNum
     */
    void updateStock(@Param("skuId") Long skuId,
                     @Param("wareId") Long wareId,
                     @Param("skuNum") Integer skuNum);

    /**
     * 查询sku是否有库存
     * @param skuId
     * @return
     */
    long getSkuStock(@Param("skuId") Long skuId);
}
